:root {
  --primary-color: #5D9CEC;
  --secondary-color: #FF6B6B;
  --accent-color: #FFCE54;
  --text-color: #333;
  --bg-color: #F9F9F9;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Comic Neue', cursive;
  background-color: var(--bg-color);
  color: var(--text-color);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23F9F9F9"/><path d="M20,20 Q40,5 60,20 T100,20 M20,50 Q40,35 60,50 T100,50 M20,80 Q40,65 60,80 T100,80" stroke="%23E1E8F0" stroke-width="2" fill="none"/></svg>');
  background-repeat: repeat;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 30px 0;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="8" fill="%23ffffff" opacity="0.2"/><circle cx="50" cy="30" r="5" fill="%23ffffff" opacity="0.2"/><circle cx="80" cy="20" r="6" fill="%23ffffff" opacity="0.2"/><circle cx="30" cy="60" r="7" fill="%23ffffff" opacity="0.2"/><circle cx="70" cy="50" r="4" fill="%23ffffff" opacity="0.2"/></svg>');
  background-repeat: repeat;
  opacity: 0.3;
}

.header h1 {
  font-size: 2.5em;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  position: relative;
}

.header p {
  font-size: 1.2em;
  margin: 10px 0 0;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.song-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.song-card {
  background-color: white;
  border-radius: 15px;
  width: 250px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.song-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.song-icon {
  font-size: 3em;
  margin: 20px 0;
  color: var(--primary-color);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-title {
  font-weight: bold;
  font-size: 1.2em;
  margin: 10px 0;
  padding: 0 10px;
  color: var(--text-color);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-link {
  display: block;
  background-color: var(--accent-color);
  color: white;
  padding: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
}

.song-link:hover {
  background-color: var(--secondary-color);
  color: white;
}

.karaoke-container {
  max-width: 800px;
  margin: 20px auto 40px;
  padding: 20px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: none;
}

.karaoke-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--accent-color);
}

.karaoke-title {
  color: var(--primary-color);
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
}

.back-button {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-button:hover {
  background-color: #FF5252;
  transform: scale(1.05);
}

.lyrics-container {
  font-size: 18px;
  line-height: 1.8;
  border: 2px dashed var(--accent-color);
  border-radius: 10px;
  background-color: #FFF9E6;
  padding: 20px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.lyrics-line {
  margin-bottom: 10px;
  transition: all 0.3s;
  padding: 5px 10px;
  border-radius: 5px;
}

.lyrics-line.active {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 1.1em;
  transform: scale(1.02);
  background-color: rgba(255, 107, 107, 0.1);
}

.karaoke-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.karaoke-controls button {
  padding: 12px 25px;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1em;
  min-width: 180px;
  justify-content: center;
}

.karaoke-controls button:hover:not(:disabled) {
  transform: scale(1.05);
}

.karaoke-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-listen {
  background-color: var(--primary-color);
  color: white;
}

.btn-stop {
  background-color: var(--secondary-color);
  color: white;
}

.btn-sing {
  background-color: #4CAF50;
  color: white;
}

.footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  background-color: var(--primary-color);
  color: white;
}

.animate-charcter {
  background-image: linear-gradient(
    -225deg,
    #231557 0%,
    #44107a 29%,
    #ff1361 67%,
    #fff800 100%
  );
  background-size: auto auto;
  background-clip: border-box;
  background-size: 200% auto;
  color: #fff;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textclip 2s linear infinite;
  display: inline-block;
}

@keyframes textclip {
  to {
    background-position: 200% center;
  }
}

.floating-music {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--secondary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.5em;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  cursor: pointer;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.voice-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.voice-selector select {
  padding: 8px 15px;
  border-radius: 20px;
  border: 2px solid var(--primary-color);
  background-color: white;
  font-family: 'Comic Neue', cursive;
}

.status-message {
  text-align: center;
  padding: 10px;
  margin: 10px 0;
  border-radius: 10px;
  font-weight: bold;
}

.status-playing {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-error {
  background-color: #ffebee;
  color: #c62828;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .song-card {
    width: 150px;
  }
  
  .header h1 {
    font-size: 2em;
  }
  
  .karaoke-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .karaoke-controls button {
    width: 100%;
  }
  
  .karaoke-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
